import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import VueAxios from 'vue-axios'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import "@/assets/css/global.css"
import VueQuillEditor from 'vue-quill-editor'

import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme

Vue.use(VueQuillEditor, /* { default global options } */)

Vue.use(ElementUI);
Vue.use(VueAxios, axios)
Vue.config.productionTip = false

axios.defaults.baseURL = "http://shop.zhuox.net/api/private/v1/"

axios.interceptors.request.use(
  config => {
    if(config.url!='login'){
      config.headers.Authorization = sessionStorage.getItem('token')
    }
    return config
  }
);

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
